﻿@model ThaireInvestmentWeb.Models.EditUnitTrustGuaranteeModel
@{
    ViewBag.Title = "Edit UnitTrustGuarantee";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<script>
    $(document).ready(function () {

        $("#StartDate,#EndDate").datepicker(
            {
                dateFormat: 'dd/mm/yy',
                yearRange: "-30:+40",
                showOn: 'button',
                showAnim: 'fadeIn',
                changeMonth: true,
                changeYear: true,
                showButtonPanel: true,

                buttonImage: '@Url.Content("~/Content/images/Calendar.png")',

            });
        $("#CancelBtn").click(function (event) {
            //showConfirm("Are you sure to cancel ?", CancelBtnAction);
            showConfirm(null, CancelBtnAction);
            return false;
        });

    });
        function CancelBtnAction(event) {
            window.location.href = 'EditUnitTrustHeader?headerId=@Model.HeaderID';
    }
</script>


<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<table class="navi" width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
        <td style="width: 100%;">
            <div class="navi">
                Instrument Type > <a href="@Url.Action("ManageUnitTrust", "UnitTrust", new { headerId = @Model.HeaderID })">Unit Trust</a> > <a href="@Url.Action("EditUnitTrustHeader", "UnitTrust", new { headerId = @Model.HeaderID })">Header</a> >Guarantee
            </div>
        </td>
    </tr>
</table>
<table class="tableheader" width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
        <td height="38" align="center" style="width: 100%; text-align: center;">INPUT Sale Unit Trust</td>
    </tr>
</table>
<table width="100%" border="0" align="center">
    <tr>
        <td>
            @Html.Partial("_UnitTrustHeaderView", Model.ScreenData.HeaderDTO)
            @Html.ValidationSummary(true)
            @using (Html.BeginForm("EditGuaranteeTransaction", "UnitTrust", FormMethod.Post, new { id = "mainForm" }))
            {
                <table style="margin-top: 20px;" class="tableform" width="100%" border="5" align="center" cellspacing="2">
                    <tr>
                        <td style="height: 4px">&nbsp;</td>
                        <td style="height: 4px"></td>
                        <td style="width: 236px; height: 4px;"></td>
                        <td style="height: 4px"></td>
                        <td style="height: 4px"></td>
                        <td style="height: 4px"></td>
                    </tr>
                    <tr>
                        <td style="width: 248px">
                            <div align="right">ประเภทธุรกรรม: </div>
                        </td>
                        <td width="10">&nbsp;</td>
                        <td width="260">
                            @Html.DropDownListFor(x => x.SelectedTransactionType, Model.TransactionTypeList)
                            @Html.ValidationMessageFor(model => model.SelectedTransactionType)</td>
                        <td align="right" style="width: 184px">&nbsp;</td>
                        <td width="6">&nbsp;</td>
                        <td width="223">&nbsp;</td>
                    </tr>
                    <tr>
                        <td>
                            <div align="right">Ref. No. <span class="error">* </span>: </div>
                        </td>
                        <td>&nbsp;</td>
                        <td style="width: 236px">@Html.TextBoxFor(model => model.RefNo)   @Html.ValidationMessageFor(model => model.RefNo) </td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td style="width: 248px">
                            <div align="right">ภาระผูกพัน    <span class="error">*</span> : </div>
                        </td>
                        <td>&nbsp;</td>
                        <td>
                            @Html.DropDownListFor(model => model.SelectedObligation, Model.ObligationList) @Html.ValidationMessageFor(model => model.SelectedObligation)
                        </td>
                        <td style="width: 184px">
                            <div align="right">&nbsp;</div>
                        </td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td style="width: 248px">
                            <div align="right">ภาระผูกพันตามมาตรา <span class="error">*</span>   : </div>
                        </td>
                        <td>&nbsp;</td>
                        <td>@Html.DropDownListFor(model => model.SelectedObligationNo, Model.ObligationNoList) @Html.ValidationMessageFor(model => model.SelectedObligationNo)                 &nbsp;</td>
                        <td style="width: 184px">
                            <div align="right"></div>
                        </td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                    </tr>
                    <tr>
                        <td style="width: 248px">
                            <div align="right">Unit <span class="error">*</span> : </div>
                        </td>
                        <td>&nbsp;</td>
                        <td>@Html.TextBoxFor(model => model.Unit, new { @class = "inputNumberField", @Value = ThaireInvestmentWeb.Util.WebUtil.FormatCurrency0(@Model.Unit) })
                            @Html.ValidationMessageFor(model => model.Unit)</td>
                        <td style="width: 184px">&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;&nbsp;</td>
                    </tr>
                    <tr>
                        <td style="width: 248px">
                            <div align="right">Start Date <span class="error">*</span>  : </div>
                        </td>
                        <td>&nbsp;</td>
                        <td>@Html.TextBoxFor(model => model.StartDate, new {  style = "width: 80px;", @Value = string.Format("{0:dd/MM/yyyy}", Model.StartDate) })   @Html.ValidationMessageFor(model => model.StartDate)   (Ex.31/12/2014)</td>
                        <td style="width: 184px">
                            <div align="right">End Date <span class="error">*</span> : </div>
                        </td>
                        <td>&nbsp;</td>
                        <td>@Html.TextBoxFor(model => model.EndDate, new {  style = "width: 80px;", @Value = string.Format("{0:dd/MM/yyyy}", Model.EndDate) })   @Html.ValidationMessageFor(model => model.EndDate)   (Ex.31/12/2014)</td>
                    </tr>

                    <tr>
                        <td style="width: 248px">&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                        <td style="width: 184px">&nbsp;</td>
                        <td>&nbsp;</td>
                        <td>&nbsp;</td>
                    </tr>
                </table>
    
                <table width="95%" border="0" align="center">
                    <tr>
                        <td>
                            <div align="center">

                                <input id="SubmitBtn" type="submit" name="SubmitBtn" value=" Submit " class="button" need-confirm="true" />
                                &nbsp;&nbsp; 
                                <input id="CancelBtn" type="button" name="CancelBtn" value=" Cancel " class="button" />
                            </div>
                        </td>
                    </tr>

                </table>
    
                @Html.HiddenFor(x => x.UpdateMode);
                @Html.HiddenFor(x => x.HeaderID);
                @Html.HiddenFor(x => x.TransactionID);

            }

        </td>
    </tr>
</table>
